<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">

    <link href="/bootstraptable/bootstrap-table.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div style="text-align: right">
        <button class="btn btn-default" id="StorageCell_add">提交</button>
        <button type="button" class="btn btn-default"><a href="javascript:history.back(-1)"
                                                         style="color: black">返回</a></button>

    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="h4" align="center">安全库存配置单</div>
        </div>
        <div class="panel-body">
            <form class="form-horizontal" action="" id="form_StorageCell_add">
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">产品名称</label>
                        <div class="col-sm-8">
                            <input type="text" name="productName" id="productName"
                                   class="form-control text_no_border" style="background-color:white" readonly
                                   value="">
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">产品编号</label>
                        <div class="col-sm-8">
                            <input type="text" name="productId" id="productId"
                                   class="form-control text_no_border" style="background-color:white" readonly
                                   value="">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">库存报警下限数</label>
                        <div class="col-sm-8">
                            <input type="text" name="minAmount" id="minAmount"
                                   class="form-control text_no_border ">
                        </div>
                    </div>
                <div class="col-sm-6">
                    <label class="col-sm-4 control-label">库存报警上限数</label>
                    <div class="col-sm-8">
                        <input type="text" name="maxAmount" id="maxAmount"
                               class="form-control text_no_border">
                    </div>
                </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">登记人</label>
                        <div class="col-sm-8">
                            <input type="text" name="register" id="register"
                                   class="form-control text_no_border"
                                   value="">
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">登记时间：</label>
                        <div class="col-sm-8">
                            <input type="text" name="registerTime" id="registerTime"
                                   class="form-control text_no_border"
                                   value="">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">配置要求：</label>
                        <div class="col-sm-8">
                            <textarea roes="3" cols="60" name="config" id="config"
                                      class="form-control "></textarea>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-sm-4 control-label">最大储存量：</label>
                        <div class="col-sm-8">
                            <input type="text" name="maxCapacityAmount" id="maxCapacityAmount"
                                   class="form-control text_no_border"
                                   value="">
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>
<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<!--<script type="text/javascript" src="/js/index.js"></script>-->

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
    $(function () {

        let shangpinbianhao = localStorage.getItem("shangpinbianhao1")
        $.post("/design/productIdshow", {"productId": shangpinbianhao}, function (res) {
            $("#productName").val(res.productName)
            $("#productId").val(res.productId)
            $("#register").val(res.register)
            $("#registerTime").val(fortime())

        })
    })
    $("#StorageCell_add").click(function () {
        let param = $("#form_StorageCell_add").serialize();
        console.log("param", param)
        $.post("/StorageCell/add", param, function (res) {
            location.href="/design/succeed"
        })

    })

    function fortime() {
        let date = new Date();
        let y = date.getFullYear();
        let m = date.getMonth() + 1;
        let d = date.getDate();
        let h = date.getHours();
        let mm = date.getMinutes();
        let s = date.getSeconds();
        return (y + '-' + add(m) + '-' + add(d) + ' ' + add(h) + ':' + add(mm) + ':' + add(s));
    }

    function add(m) {
        return m < 10 ? '0' + m : m
    }
</script>
</body>
</html>